function select() {

	var product_id = window.opener.document.form_regist.product_id.value;
	var product_name = window.opener.document.getElementById("product_name").innerHTML;
	var product_ids = product_id.split(",");
	var product_names = [];
	product_names[0] = product_name;
	
	var isCheck = false;
	for (var i = 0; i < document.inputForm.length; i++) {
		if (document.inputForm.elements[i].checked) {
			isCheck = true;
			
			var tmp = document.inputForm.elements[i].value.split("#");
			var isExist = false;
			for (var j = 0; j < product_ids.length; j++) {
				if (product_ids[j] == tmp[0]) {
					isExist = true;
					break;
				}
			}

			if (!isExist) {
				if (product_id == "") {
					product_id = tmp[0];
					product_ids[0] = tmp[0];
				} else {
					product_ids[product_ids.length] = tmp[0];
				}
				var tmp1 = "<span id = \"span-product-" + tmp[0] + "\"><br><a href=\"javascript:deleteProduct(" + tmp[0] + ");\">削除</a>" + tmp[1] + "</span>";
				if (product_name == "") {
					product_name = tmp[1];
					product_names[0] = tmp1;
				} else {
					product_names[product_names.length] = tmp1;
				}
			}
		}
	}

	if (!isCheck) {
		alert("商品が選択されていません");
	} else {
		window.opener.document.form_regist.product_id.value = product_ids.join();
		window.opener.document.getElementById("product_name").innerHTML = product_names.join("");

		window.close();
	}
}